<?php
/**
 * @category   Application_Extensions
 * @package    Talktangle Plugin 
 * @copyright  Idragon Co., Ltd.
 * @license
 */
class Talktangle_Widget_PromotiontangleController extends Engine_Content_Widget_Abstract {
		
	public function indexAction() {
	    
        $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();
        $coreApi = Engine_Api::_()->talktangle();
        
        $select = $coreApi->getPromotionSelect($viewer);
        if (is_null($select) || empty($select)) {
            return $this->setNoRender();
        }
        
        $this->view->paginator = $paginator = Zend_Paginator::factory($select);

        // Set item count per page and current page number
        $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 4));
        $paginator->setCurrentPageNumber($this->_getParam('page', 1));
        $this->view->paginator = $paginator;
     
       
	}
}